﻿<%@ Page Title="Profile" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="UserProfile.aspx.cs" Inherits="Presentation.AdminPresentation.UserProfile" %>

<%@ Register Src="~/UserControl/UserProfile.ascx" TagName="ProfileControl" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/EditProfile.ascx" TagName="EditProfileControl" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("span[type]").hide();
            var role = getParameterByName("rname");
            var roleLower = role.toLocaleLowerCase();
            if (roleLower == "contractor") {
                $("span[type=Contractor]").show(500);
            }
            else if (roleLower == "client") {
                $("span[type=Client]").show(500);
            }
            else if (roleLower == "consultant") {
                $("span[type=Consultant]").show(500);
            }
        });

        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(window.location.search);
            if (results == null)
                return "";
            else
                return decodeURIComponent(results[1].replace(/\+/g, " "));
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="page-heading">
        <h1>
            Profile</h1>
    </div>
    <asp:Panel ID="ProfilePanel" Visible="true" runat="server">
        <uc:ProfileControl ID="ViewUserProfile" runat="server" />
    </asp:Panel>
    <asp:Panel ID="EditProfilePanel" Visible="false" runat="server">
        <uc:EditProfileControl ID="EditUserProfile" runat="server" />
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer" runat="server">
</asp:Content>
